package com.saic.utils;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.saic.produce.OracleProduce;

public class SendRunnable implements Runnable {
	private String tableName;
	private String rowKey;
	
	public SendRunnable(String tableName,String rowKey){
		this.setTableName(tableName);
		this.setRowKey(rowKey);
	}

	public void run() {
		Map<String, String> dataMap1 = new HashMap<String, String>(),
				dataMap2 = new HashMap<String, String>(),
				dataMap3 = new HashMap<String, String>();
		dataMap1.put("VIEW_ID","60745");
		dataMap1.put("VIEW_CODE","V01");
		dataMap1.put("VIEW_NAME","当期值");
		dataMap1.put("VIEW_PARENT_ID","60744");
		dataMap1.put("tableName", "T_ETL_JT_HPL_D_EXP_VIEW");
		dataMap1.put("rowkey", "VIEW_ID");
		             
		dataMap2.put("VIEW_ID","60747");
		dataMap2.put("VIEW_CODE","V02");
		dataMap2.put("VIEW_NAME","累计值");
		dataMap2.put("VIEW_PARENT_ID","60744");
		dataMap2.put("tableName", "T_ETL_JT_HPL_D_EXP_VIEW");
		dataMap2.put("rowkey", "VIEW_ID");
		             
		dataMap3.put("VIEW_ID","60749");
		dataMap3.put("VIEW_CODE","V03");
		dataMap3.put("VIEW_NAME","累计输入");
		dataMap3.put("VIEW_PARENT_ID","60744");
		dataMap3.put("tableName", "T_ETL_JT_HPL_D_EXP_VIEW");
		dataMap3.put("rowkey", "VIEW_ID");
		
		List<Map<String,String>> listMap = new ArrayList<Map<String,String>>();
		listMap.add(dataMap1);
		listMap.add(dataMap2);
		listMap.add(dataMap3);
		
		OracleProduce.sendtoKafka(OracleUtils.getDate(this.tableName,this.rowKey));
	}

	public String getRowKey() {
		return rowKey;
	}

	public void setRowKey(String rowKey) {
		this.rowKey = rowKey;
	}

	public String getTableName() {
		return tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

}